#
## Simple .so Makefile
#
#
vpath %.c src
vpath %.h include
CC      := gcc
LD      := gcc
CFLAGS  :=
LDFLAGS := -fPIC -shared 
SOURCE  := $(wildcard src/*.c)
OBJS    := $(patsubst src/%.c,src/%.o,$(SOURCE))
BIN     := ga
TARGET_LIB := lib$(BIN).so

all:$(OBJS)
		    $(LD) $(LDFLAGS) -o $(TARGET_LIB) $(OBJS)  
			$(CC) -Iinclude  -L./ -lga -o $(BIN) src/ga.c -Wl,-rpath,./ 

%.o:%.c
		    $(CC) -c $(CFLAGS) -Iinclude  $< -o $*.o

.PHONY: clean

clean:
	    rm -rf *.so src/*.o *.out $(BIN) 
